package org.springd3.d2.test1;

import org.springd3.d2.dao.NewsTypeMapper;
import org.springd3.d2.pojo.NewsType;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Test2 {
    public static void main(String[] args) {
        ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
        NewsTypeMapper newsTypeMapper =(NewsTypeMapper) context.getBean("newsTypeMapper");
        List<NewsType> list= newsTypeMapper.getAllNewsType();
        for (int i=0;i<list.size();i++){
            System.out.println(list.get(i).getTypeName());

        }

    }

}
